using System;

namespace Com.Binaria.SISCOB.Funcional.DTO 
{

    [Serializable]
    public class ItemCartolaFuncionalDTO 
    {

        public System.Int32? Id
        {
            get;
            set;
        }

        public System.Int32 Sucursal
        {
            get;
            set;
        }

        public System.String NmrOperacion
        {
            get;
            set;
        }

        public System.String DscOperacion
        {
            get;
            set;
        }

        public System.Int64 Monto
        {
            get;
            set;
        }

        public System.DateTime? FchOperacion
        {
            get;
            set;
        }

        public string FchOperacionText
        {
            get
            {
                if (FchOperacion.HasValue && FchOperacion.Value.Year > 1000)
                    return string.Format("{0}/{1}/{2}", FchOperacion.Value.Day.ToString("00"), FchOperacion.Value.Month.ToString("00"), FchOperacion.Value.Year.ToString("0000"));
                return string.Empty;
            }
            set
            {
                FchOperacion = null;
                if (!string.IsNullOrEmpty(value))
                {
                    string[] sVal = value.Split(new char[] { '/', '-' }, StringSplitOptions.RemoveEmptyEntries);
                    if (sVal.Length == 3)
                        FchOperacion = new DateTime(Convert.ToInt32(sVal[2]), Convert.ToInt32(sVal[1]), Convert.ToInt32(sVal[0]));
                }
            }
        }

        public System.Boolean EstaProcesado
        {
            get;
            set;
        }

        public System.String Tipo
        {
            get;
            set;
        }

        public System.String TipoText
        {
            get;
            set;
        }



        string _Text = string.Empty;
        public string Text
        {
            get { return string.IsNullOrEmpty(_Text) ? Id.ToString() : _Text; }
        }
    }
}
